cmake_minimum_required(VERSION 3.12)
project(myplugins)

file(GLOB ${PROJECT_NAME}_SOURCES
    "${CMAKE_CURRENT_SOURCE_DIR}/*.cu"
)

add_definitions(-std=c++11)
add_definitions(-DAPI_EXPORTS)
add_definitions(-O2 -pthread)
option(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
set(CMAKE_CXX_STANDARD 11)

include_directories(${PROJECT_SOURCE_DIR}/include)

# include and link dirs of cuda and tensorrt, you need adapt them if yours are different
# cuda
include_directories(/usr/local/cuda/include)
link_directories(/usr/local/cuda/lib64)

# tensorrt
include_directories(/usr/include/x86_64-linux-gnu/)
link_directories(/usr/lib/x86_64-linux-gnu/)
link_directories(/usr/src/tensorrt/lib)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Ofast -g -Wfatal-errors -D_MWAITXINTRIN_H_INCLUDED")
cuda_add_library(${PROJECT_NAME} STATIC yololayer.cu)
target_link_libraries(${PROJECT_NAME} nvinfer cudart spdlog::spdlog)
